﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Template.Master" Inherits="System.Web.Mvc.ViewPage<JLL.China.Web.Areas.Portal.Models.EventModel>" %>

<%@ Import Namespace="System.Globalization" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%--<div id="page-heading">
        <h1>
            Manage Events
        </h1>
    </div>
    <div class="menu-nav">
        <%//Html.RenderPartial("TopMenu");%>
    </div>--%>
    <%Html.RenderPartial("Side");%>
    <!-- end page-heading -->
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="<%=Url.Content("~/Content/images/shared/side_shadowleft.jpg")%>" width="20"
                    height="300" alt="" />
            </th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;
            </td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="<%=Url.Content("~/Content/images/shared/side_shadowright.jpg")%>" width="20"
                    height="300" alt="" />
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner ...................................................................... START -->
                <div id="content-table-inner">
                    <div id="tab-language">
                       
                        <!--  start message-blue -->
                        <% Html.RenderPartial("Measage");%>
                        <!--  end message-blue -->
                    </div>
                    <!--  start step-holder -->
                    <!--  start step-holder -->
                    <div id="step-holder">
                        <div class="step-no">
                            1</div>
                        <div class="step-dark-left">
                            Event Details</div>
                        <div class="step-dark-round">
                            &nbsp;</div>
                        <div class="clear">
                        </div>
                    </div>
                    <!--  end step-holder -->
                    <%Html.RenderPartial("Form", this.Model); %>
                </div>
                <!--  end table-content  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;
            </td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
    <% if (this.Model.Event.Event_ID == null)
       { %>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#EventDateEnd").datepicker("setDate", new Date());
            $("#EventDate").datepicker("setDate", new Date());
        });
    </script>
    <% } %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CSS" runat="server">
    <%--<link href="<%=Url.Content("~/Scripts/qtip2/jquery.qtip.min.css") %>" rel="stylesheet" type="text/css" />--%>
    <link href="<%=Url.Content("~/Scripts/jquery.validation/validationEngine.jquery.css")%>"
        rel="stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/Scripts/chosen/chosen.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/Content/css/mod-listing.css")%>" rel="stylesheet" type="text/css" />
    <%--<link rel="Stylesheet" href="<%=Url.Content("~/Content/css/mod-event.css")%>" type="text/css" />--%>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
    <!-- timepicker -->
    <%--<link rel="stylesheet" href="<%=Url.Content("~/Scripts/datepicker/jquery-ui.css")%>" />--%>
  <%--  <link href="<%=Url.Content("~/Scripts/timepicker/jquery.timepicker.css")%>" rel="stylesheet"
        type="text/css" />--%>
        
      <link href="<%=Url.Content("~/Scripts/timepicker/jquery-ui-timepicker-addon.css")%>" rel="stylesheet"
        type="text/css" />   
        
    <!-- datepicker -->
    
    <!-- colorpicker -->
    <link href="<%=Url.Content("~/Scripts/colorpicker/colorPicker.css")%>" rel="stylesheet"
        type="text/css" />
      <link href="<%=Url.Content("~/Scripts/qtip2/jquery.qtip.min.css") %>" rel="stylesheet"
        type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JS" runat="server">
    <!-- datepicker -->
    <%--  <script src="<%=Url.Content("~/Scripts/datepicker/jquery-1.9.0.js")%>" type="text/javascript"></script>--%>

    <script src="<%=Url.Content("~/Scripts/datepicker/jquery-ui.js")%>" type="text/javascript"></script>

    <%--<script src="<%=Url.Content("~/Scripts/datepicker/jquery.jdpicker.js")%>" type="text/javascript"></script>--%>
    <!-- timepicker -->
    <%--<script src="<%=Url.Content("~/Scripts/timepicker/jquery.timepicker.js")%>" type="text/javascript"></script>--%>
    <script src="<%=Url.Content("~/Scripts/timepicker/jquery-ui-sliderAccess.js")%>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/timepicker/jquery-ui-timepicker-addon.js")%>" type="text/javascript"></script>
    

    <%--<script src="<%=Url.Content("~/Scripts/timepicker/jquery.timepicker.min.js")%>" type="text/javascript"></script>--%>
    <!-- colorpicker -->
    <script src="<%=Url.Content("~/Scripts/colorpicker/jquery.colorPicker.js")%>" type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/colorpicker/jquery.colorPicker.min.js")%>"
        type="text/javascript"></script>
    <%--<script src="<%=Url.Content("~/Scripts/colorpicker/jquery-1.4.4.min.js")%>" type="text/javascript"></script>--%>
    
    <!--delete involk-->
<%--
    <script src="<%=Url.Content("~/Scripts/Run.js")%>" type="text/javascript"></script>    
--%>
    <script type="text/javascript">

        $(function() {
            $('#EventDate').datepicker({
                showButtonPanel: true,
                showAnim: "fadeIn",
                onClose: function(selectedDate) {
                $("#EventDateEnd").datepicker("option", "minDate", selectedDate);
                }
            });
            $('#EventDateEnd').datepicker({
                showButtonPanel: true,
                showAnim: "fadeIn",
                onClose: function(selectedDate) {
                $("#EventDate").datepicker("option", "maxDate", selectedDate);
                }
            });
            $("#EventDateEnd").datepicker("option", "dateFormat", "dd MM, yy");
            $("#EventDate").datepicker("option", "dateFormat", "dd MM, yy");
          
            
            /*$('#EventTime').timepicker({
                'timeFormat': 'h:i A',
                'step': 15
            });
            $('#EventTimeEnd').timepicker({
                'timeFormat': 'h:i A',
                'step': 15
            });*/
            $('#EventTime').timepicker({
                hourGrid: 4,
                minuteGrid: 10,
                timeFormat: 'hh:mm tt'
            });
            
            
            $('#EventTimeEnd').timepicker({
                hourGrid: 4,
                minuteGrid: 10,
                timeFormat: 'hh:mm tt'
            });
          
            /*$('#EventTimeEnd').on('timeFormatError', function() {
                $('#EventTimeEnd').val("");
            });
            $('#EventTime').on('timeFormatError', function() {
                $('#EventTime').val("");
            });*/
        });
     
      
      
    </script>

    <%--
    <script  src="http://code.jquery.com/jquery-1.8.3.js" type="text/javascript"></script>
    <script  src="http://code.jquery.com/ui/1.9.2/jquery-ui.js" type="text/javascript"></script>
    <!-- -->--%>

    <script src="<%=Url.Content("~/Scripts/jquery.validation/jquery.validationEngine-en.js")%>"
        type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/jquery.validation/jquery.validationEngine.js")%>"
        type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/chosen/chosen.jquery.min.js")%>" type="text/javascript"></script>

    <script src="<%=Url.Content("~/Scripts/ckeditor/ckeditor.js")%>" type="text/javascript"></script>

    <script type="text/javascript" src="<%=Url.Content("~/Scripts/ckeditor/adapters/jquery.js")%>"></script>

<script src="<%=Url.Content("~/Scripts/qtip2/jquery.qtip.min.js")%>" type="text/javascript"></script>


    <script language="javascript" type="text/javascript">
 
        $(document).ready(
            function() {
                $("#formID").validationEngine({
                prettySelect: true,
                useSuffix: "_chzn",
                promptPosition: "topLeft", 
                scroll: false
            });
                $('.ckeditors').ckeditor();
                $(".chzn-nosearch").chosen({ disable_search_threshold: 3 });
                $('.datedatapicker').datepicker({
                    dateFormat: 'dd-M-yy'
                });
                //            $('#EventColor').jPicker();
                $('#EventColor').colorPicker();
                // asking delete
                function Confirm(question, callback) {
                    // Content will consist of the question and ok/cancel buttons
                    var message = $('<p />', { text: question }),
                        ok = $('<button />', {
                            text: 'Ok',
                            click: function() { callback(true); }
                        }),
                        cancel = $('<button />', {
                            text: 'Cancel',
                            click: function() { callback(false); }
                        });

                    dialogue(message.add(ok).add(cancel), 'Do you agree?');

                }

                function dialogue(content, title) {
                    /* 
                    * Since the dialogue isn't really a tooltip as such, we'll use a dummy
                    * out-of-DOM element as our target instead of an actual element like document.body
                    */
                    $('<div />').qtip(
                        {
                            content: {
                                text: content,
                                title: title
                            },
                            position: {
                                my: 'center', at: 'center', // Center it...
                                target: $(window) // ... in the window
                            },
                            show: {
                                ready: true, // Show it straight away
                                modal: {
                                    on: true, // Make it modal (darken the rest of the page)...
                                    blur: false // ... but don't close the tooltip when clicked
                                }
                            },
                            hide: false, // We'll hide it maunally so disable hide events
                            style: 'qtip-light qtip-rounded qtip-dialogue', // Add a few styles
                            events: {
                                // Hide the tooltip when any buttons in the dialogue are clicked
                                render: function(event, api) {
                                    $('button', api.elements.content).click(api.hide);
                                },
                                // Destroy the tooltip once it's hidden as we no longer need it!
                                hide: function(event, api) { api.destroy(); }
                            }
                        });
                }
                //--
                //prompt for delete button
                $('.remove-btn').click(function(e) {
                    e.preventDefault(); //prevent default action for anchor
                    var self = this;
                    Confirm("Confirm removed the selected records?", function(yes) {
                        if (yes) {
                            $("#content-outer").showLoading();
                            window.location = self.href;
                        }

                    });

                });
            });
            
        function checkForm() {
            $(document).ready(function() {
                if ($('#summary').val().length > 3) {
                    $('#summary_validate').val('ok');
                }
                else {
                    $('#summary_validate').val('');
                }

                if ($('#event_content').val().length > 3) {
                    $('#content_validate').val('ok');
                }
                else {
                    $('#content_validate').val('');
                }

                if ($('#summary_local').val().length > 3) {
                    $('#summary_local_validate').val('ok');
                }
                else {
                    $('#summary_local_validate').val('');
                }

                if ($('#content_local').val().length > 3) {
                    $('#content_local_validate').val('ok');
                }
                else {
                    $('#content_local_validate').val('');
                }

            });
        }

       
    </script>
<%--ask for delete--%>

</asp:Content>
